package pyrachnid.view.component;

import java.util.ArrayList;

import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;

import pyrachnid.model.robot_model.RobotType;

public class RobotTypeComboBoxModel extends AbstractListModel implements ComboBoxModel {

	private static final long serialVersionUID = 1L;
	
	private ArrayList<RobotType> _robotTypeList;
	private RobotType _robotTypeSelection;
	
	public RobotTypeComboBoxModel(ArrayList<RobotType> p_robotTypeList) {
		_robotTypeList = p_robotTypeList;
	}

	@Override
	public Object getElementAt(int p_index) {
		return _robotTypeList.get(p_index);
	}

	@Override
	public int getSize() {
		return _robotTypeList.size();
	}

	@Override
	public Object getSelectedItem() {
		return _robotTypeSelection;
	}

	@Override
	public void setSelectedItem(Object p_robotTypeSelection) {
		_robotTypeSelection = (RobotType)p_robotTypeSelection;
	}

}
